package com.example

import java.util.Date

import org.apache.flink.api.scala.{ExecutionEnvironment, _}
import org.apache.flink.configuration.Configuration


object SourceFileDemo1 {
  // 不能放在main方法中
  case class Suppiler(name:String,number:String,part:String,cost:String,date:String)

  def main(args: Array[String]): Unit = {
    val env: ExecutionEnvironment = ExecutionEnvironment.getExecutionEnvironment
//    val df1: DataSet[String] = env.readTextFile("E:\\note\\flink-project\\temp\\word.txt")
//    df1.print()
//
//
//    val df2: DataSet[String] = env.readTextFile("E:\\note\\flink-project\\temp")
//    df2.print()

    val def3: DataSet[Suppiler] = env.readCsvFile[Suppiler]("E:\\note\\flink-project\\temp\\supplier_data.csv")
    def3.print()

    val df5: DataSet[String] = env.readTextFile("E:\\note\\flink-project\\temp\\word.zip")
    df5.print()

//    递归读取文件
    val configuration = new Configuration()
    configuration.setBoolean("recursive.file.enumeration", true)
    val df6: DataSet[String] = env.readTextFile("E:\\note\\flink-project\\temp\\file").withParameters(configuration)
    df6.print()






  }

}
